import { Injectable } from '@angular/core';
import { WindowService } from '@core/services/common/window.service';

@Injectable({
    providedIn: 'root',
})
export class UserService {

    constructor(
        private windowServe: WindowService
    ) {}

    getUserInfo() {
        const userInfo = this.windowServe.getSessionStorage('userInfo');
        if (userInfo) {
            JSON.parse(userInfo);
        }
        return userInfo;
    }

    setUserInfo(userInfo: object) {
        this.windowServe.setSessionStorage('userInfo', JSON.stringify(userInfo));
    }

}
